package com.vogue.supplymall.order.domain.service.impl;

import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.order.domain.dao.OrderBuyerDao;
import com.vogue.supplymall.order.domain.model.OrderBuyer;
import com.vogue.supplymall.order.domain.service.OrderBuyerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * The type Order buyer service.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-01-10
 */
@Service("orderBuyerService")
public class OrderBuyerServiceImpl extends BaseServiceImpl<OrderBuyer, Long> implements OrderBuyerService {

    @Resource
    private OrderBuyerDao orderBuyerDao;

    /**
     * Instantiates a new Order buyer service.
     *
     * @param baseDao the base dao
     */
    public OrderBuyerServiceImpl(BaseDao<OrderBuyer, Long> baseDao) {
        super(baseDao);
    }

    @Override
    public OrderBuyer addOrderBuyer(OrderBuyer orderBuyer) {
        return orderBuyerDao.save(orderBuyer);
    }

    @Override
    public OrderBuyer getOrderBuyerBySql(OrderBuyer orderBuyer) {
        return orderBuyerDao.selectOneByWhr(orderBuyerDao.getSqlByWhere(orderBuyer));
    }

    @Override
    public OrderBuyer searchOrderBuyerBySql(OrderBuyer orderBuyer) {
        return orderBuyerDao.searchOrderBuyer(orderBuyer);
    }
}
